# -*- coding: utf-8 -*-
# -*- frozen_string_literal: true -*-

require "rake/testtask"
require "rdoc/task"
require "<%= @scaffold.gem_path %>/manifest"
require "<%= @scaffold.gem_path %>/doc"

FileList["dev/tasks/*.rake"].each(&method(:import)) if Dir.exist? "./dev/tasks"

task :default => :test

Rake::TestTask.new(:test) do |t|
  ENV["<%= @scaffold.gem_constant %>_ALL_TESTS"] = "1"
  test_dev = "test/dev"

  t.libs.<<(*<%= @scaffold.namespace %>::Manifest.codebase).<<(<%= @scaffold.namespace %>::Manifest.test_suite)
  tests =  <%= @scaffold.namespace %>::Manifest.tests
  tests = tests.dup.<<(FileList["#{test_dev}/**/test_*.rb"]) if Dir.exist? test_dev
  t.test_files = tests
  t.warning = true
end
